// Copyright (c) 2024 CHANGLEI. All rights reserved.

import 'package:charts_grasp/src/chart/chart_series/series.dart';
import 'package:charts_grasp/src/chart/technical_indicators/technical_indicator.dart';
import 'package:charts_grasp/src/chart/trendlines/trendlines.dart';
import 'package:charts_grasp/src/common/utils/enum.dart';
import 'package:flutter/material.dart';

class LegendRenderContext {
  LegendRenderContext({
    this.size,
    required this.text,
    this.textSize,
    required this.iconColor,
    required this.iconType,
    this.point,
    required this.isSelect,
    this.trendline,
    required this.seriesIndex,
    this.trendlineIndex,
    this.seriesRenderer,
    this.isTrendline,
    this.indicatorRenderer,
  }) : series = seriesRenderer is TechnicalIndicators<dynamic, dynamic>
            ? seriesRenderer
            : seriesRenderer is CartesianSeriesRenderer
                ? SeriesHelper.getSeriesRendererDetails(seriesRenderer).series
                : seriesRenderer.series;

  String text;

  Color? iconColor;

  Size? textSize;

  LegendIconType iconType;

  Size? size;

  Size? templateSize;

  dynamic series;

  dynamic seriesRenderer;

  TechnicalIndicatorsRenderer? indicatorRenderer;

  Trendline? trendline;

  dynamic point;

  int seriesIndex;

  int? trendlineIndex;

  bool isSelect;

  bool isRender = false;

  bool? isTrendline = false;
}
